function my_fn_print(h,name,type)

set(h, 'PaperUnits','centimeters');
set(h, 'Units','centimeters');
pos=get(h,'Position');
set(h, 'PaperSize', [pos(3) pos(4)]);
set(h, 'PaperPositionMode', 'manual');
set(h, 'PaperPosition',[0 0 pos(3) pos(4)]);
if strcmp(type,'pdf')
    eval(['print(','''-dpdf''',',',name,')'])
elseif strcmp(type,'eps')
    eval(['print(','''-depsc2''',',',name,')'])
else
    error('Specify third argument as pdf or eps');
end
end